<?php

/**
 * Created by PhpStorm.
 * User: evan
 * Date: 16/9/19
 * Time: 上午1:14
 */
class Operate extends MY_Api_Controller
{
    /**
     * 投票
     */
    public function vote()
    {
        $uid = $this->uid;
        $vid = (int)$this->input->get_post('vid');


        $this->load->service('voice/service_voice_operate');
        $data = $this->service_voice_operate->vote($vid, $uid);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 删除呼声
     */
    public function delete()
    {
        $uid = $this->uid;
        $vid = (int)$this->input->get_post('vid');


        $this->load->service('voice/service_voice_operate');
        $data = $this->service_voice_operate->delete($vid, $uid);


        $this->json_output($data['data'], $data['status']);
    }
}